SpatialStream® Code Examples

Neighborhood Thematic Mapping

Using the Neighborhood Boundaries, GetMap, SLD, and Legend SpatialStream® components, you can create dynamic trend maps for your mapping application with your own data or data available through the SpatialStream® Content Library. This example will demonstrate how create a custom neighborhood thematic map, use GetMap to display the map overlay and generate a legend image with Legend. The thematic map will display the year over year change in media home sales price, summarized to neighborhoods for the Irvine, California area.

Creating thematic maps using SpatialStream® has several advantages including performance, ease, and interactivity. SpatialStream® generated thematic maps relieve developers from the task of linking tabular data to spatial data (home sales to neighborhood boundaries here) and make it easy to define new map styles and trend views with only a new SLD.

Neighborhood Boundaries | GetMap | Legend | SLD

var neighborhood = new Dmp.Layer.WMSLayer("boundary", "SS", {
ignoreHoles: true, antiAlias: true
});
neighborhood.addChild("neighborhoodPoly", "DMP_LICENSE/NEIGHBORHOODSTATS", "$(ACCOUNT_FOLDER)SLD/NeighborhoodThematic.sld.xml", {
zoomRange: {
min: 10, max: 19
}
});
neighborhood.addChild("neighborhoodLabel", "DMP_LICENSE/NEIGHBORHOODSTATS", "$(ACCOUNT_FOLDER)SLD/NeighborhoodLabel.sld.xml", {
zoomRange: {
min: 12, max: 19
}
});
map.addLayer(neighborhood);

//----------------

var baseUrl = Dmp.Env.Connections["SS"].getBaseUrl();
var imgObj = document.getElementById("legendImg");
imgObj.src = baseUrl + "legend.aspx?&layer=DMP_LICENSE/NEIGHBORHOODSTATS&SLD=$(ACCOUNT_FOLDER)SLD/NeighborhoodThematic.sld.xml&headers=0";


Run Sample   View Video   Back To Index